<p id="notice"><%= notice %></p>

<h1>Clients</h1>

<table>
  <thead>
    <tr>
      <th>Username</th>
      <th>Sex</th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @clients.each do |client| %>
      <tr>
        <td><%= client.username %></td>
        <td><%= client.sex %></td>
        <td><%= link_to 'Show', client %></td>
        <% if can? :update, client %>
          <td><%= link_to 'Edit', edit_client_path(client) %></td>
        <% end %>
        <% if can? :destroy, client %>
          <td><%= link_to 'Destroy', client, method: :delete, data: { confirm: 'Are you sure?' } %></td>
        <% end %>
      </tr>
    <% end %>
  </tbody>
</table>

<br>
<% if can? :create, @clients %>
  <%= link_to 'New Client', new_client_path %>
<% end %>

<%= link_to 'Back', root_path %>
